package a;

//p183 泛型接口
interface Shopping<T>{//定义泛型接口
    public T getObj(T obj);//定义抽象方法
}
class ShopName implements Shopping<String>{
    @Override
    public String getObj(String obj){
        return obj;
    }
}
class ShopCount implements Shopping<Integer>{
    @Override
    public Integer getObj(Integer obj){
        return obj;
    }
}
public class demo2 {
    public static void main(String[] args) {
        ShopName shopName = new ShopName();
        System.out.println("商品名称：" + shopName.getObj("纸巾"));
        ShopCount shopCount = new ShopCount();
        System.out.println("商品数量：" + shopCount.getObj(30) + "袋");
    }
}
